<? 
	require("required/dbconnect.php");
	require("required/share_function.php");
	require("required/header.php");
	require("required/chkuser.php");
	$id=$_GET['id'];
	
	$chk=mysql_query("select count(*)as result from os_favorite where pid=$id and uid=$member_id")or die(mysql_error());
	
	$get_pro=mysql_query("select product_name_chn from os_products where id=$id");
 ?>
		<td valign="top" width="660">
				<table width="100%">
					<td align="right">
							<table id="Table_01" width="280" height="45" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="13" rowspan="3" align="right">
										<img src="images/product_title_01.jpg" width="13" height="45" alt=""></td>
									<td width="263" height="10" style="background:url('images/product_title_02.jpg');background-repeat:repeat-x"></td>
									<td width="28" rowspan="3" align="left">
										<img src="images/product_title_03.jpg" width="11" height="45" alt=""></td>
								</tr>
								<tr>
									<td background="images/product_title_04.jpg" height="26">
										Current Position <img src="images/arrow.gif"> <font style="font-size:12px;font-weight:bolder"><?= $mainpage ?></font> <img src="images/arrow.gif"> <font style="font-size:12px;font-weight:bolder">My Cart</font> 
									</td>
								</tr>
								<tr>
									<td style="background:url('images/product_title_05.jpg');background-repeat:repeat-x" height="9"></td>
								</tr>
							</table>
						<br><br>
						</td>
						<tr align="center">
						<?
							if(mysql_result($chk,0,"result")>0)
							{
						?>
						<td>
							<font color="#FF0000"><strong><?= mysql_result($get_pro,0,"product_name_chn") ?></strong>already in your collection box</font>
							
						</td>
						<? 
							}
							else
							{
								$insert=mysql_query("insert into os_favorite (uid,pid,add_datetime)values($member_id,$id,now())");
								
						?>
						<td><strong><?= mysql_result($get_pro,0,"product_name_chn") ?></strong>is successfully added into your collection box��</td>	
						<? 
							} 
						?>
						</tr>
						<tr>
							<td align="center"><input type="button" class="button" value="Back" onClick="window.open('os_view_full.php?id=<?= $id ?>','_self')"></td>
						</tr>
				</table>
		</td>
<? require("required/footer.php") ?>		